import React, { Component } from 'react'
import styles from './index.less'
import arrowImg from '@/assets/imgs/long_arrow@2x.png'
class AirlineComponent extends Component {
  render() {
    const { airports } = this.props
    return (
      <div className={styles.airlineBox}>
        <div className={styles.title}>航线信息</div>
        <ul className={styles.airline}>
          {
            airports.map(item =>
              (
                <li className={styles.airport} key={item.code}>
                  <div className={styles.airportName} style={{ width: item.cityName.length * 14 }}>
                    <span>{item.cityName}</span>
                    <span>{item.code}</span>
                  </div>
                  <img src={arrowImg} alt="" className={styles.arrow} />
                </li>
              )
            )
          }
        </ul>
      </div>
    )
  }
}
export default AirlineComponent
